package News.service.impl;

import java.util.List;

import News.dao.Inland_NewsDao;
import News.dao.impl.Inland_NewsDaoImpl;
import News.entity.Inland_News;
import News.service.Inland_NewsService;

public class Inland_NewsServiceImpl implements Inland_NewsService{
	
	private Inland_NewsDao IO = new  Inland_NewsDaoImpl();
	
	public List<Inland_News> findAllNewsInfo() {
		
		return IO.findAllInlandNews();
	}

	public boolean delNewsById(int id) {
		if(IO.delNewsId(id) <1){
			return false;
		}else{
			return true;
		}
	}

	public boolean addNews(int NewsId, String NewsContent, String Time,int NumOfRead) {
		if(IO.addNews(NewsId, NewsContent, Time, NumOfRead) <1){
		return false;
		}else{
			return true;
		}
	}

	public boolean updateNews(int NewsId, String NewsContent, String Time,int NumOfRead) {
		boolean flag = true;
		if(IO.updateNews(NewsId, NewsContent, Time, NumOfRead)>0){
			return flag;
		}
		return false;
	}

	public List<Inland_News> getPageNewsList(int CurrNo, int PageSize) {
		
		return IO.getPageNewsList(CurrNo, PageSize);
	}

	public int getTotalCount() {
		// TODO Auto-generated method stub
		return IO.getTotalCount();
	}
}
